<template>
  <Dialog title="详情" v-model="dialogVisible" width="80%" center class="of-hidden">
    <Info :data="data" />
    <el-divider />
    <Table :userId="data.id" />
  </Dialog>
</template>
<script setup lang="ts">
import Info from './components/Info.vue'
import Table from './components/Table.vue'
import * as UserApi from '@/api/member/user'

const dialogVisible = ref(false) // 弹窗的是否展示
const data = ref<UserApi.UserVO>({} as UserApi.UserVO)

/** 打开弹窗 */
const open = async (id?: number) => {
  data.value = await UserApi.getDistributionInfo(id)
  dialogVisible.value = true
}
defineExpose({ open }) // 提供 open 方法，用于打开弹
</script>
<style scoped lang="scss">
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
